/*  保存评论
 *  params: type      类型：1-供求
 *  params: sub_id    子类型，根据不同的type，sub也不同   [type=1]  a_require.id
 *  params: content   评论的内容
 *  params: url       成功后跳转的连接
 */
function save(type,subID,content,url){
  if (content == "") {
    alert("请输入内容");
    return ;
  }
  var data = {
    type:type,
    sub_id:subID,
    content:content
  };
  ajax.send('/main/public.php/comment/saveAjax/',data,function(obj){
    var status = obj.status;
    var info = obj.info;
    if (status == 0) {
      alert(info);
      window.location.href = '/pw8/login.php';
    }else if (status == 1) {
      alert(info);
      window.location.href = url;
    }else if (status == 2) {
      window.location.href = url;
    }

  });
}